package com.mlz.mlzmall.ui.utils;

/**
 * describe :
 * Created by Benny on 2016/6/23.
 * PackageName com.mlz.mlzmall.ui.utils.
 * ProjectName mlzmall_android.
 */

public class DataUtils {
    public static String getString(String str) {
        if (str != null) {
            return String.valueOf(str);
        } else
          return "";   // default: "" (nothing)
    }

    public static int getInt(Object regionCode) {
        if (regionCode != null) {
//            // Try to handle received double value (get integer part only)
//            Double dbValue = (Double)regionCode;
//            String text = String.valueOf(dbValue);
//            String result = text.substring(0, text.indexOf("."));
            return Integer.parseInt(regionCode.toString());
        }
        else
            return 0;   // default: 0 (not specified)
    }

}
